package com.example.pjy.mapper;

import com.example.pjy.pojo.Academic;
import com.example.pjy.pojo.TotalScore;
import org.apache.ibatis.annotations.*;

import java.util.List;
@Mapper
public interface TotalScoreMapper {
//    void insert(Total_Score total_score);
//    void deleteById(int student_id);
//    void update(Total_Score total_score);
//    List<Total_Score> selectAll();
//    Total_Score selectById(int student_id);



    //新增
    @Insert("insert into totalScore (studentId,politicalScore,researchScore,socialScore)" +
            "values(#{studentId},#{politicalScore},#{researchScore},#{socialScore})")
    void add(TotalScore totalScore);



    //查询所有
    @Select("select * from totalScore")
    List<TotalScore> list();


    //根据id查询
    @Select("select * from totalScore where studentId = #{studentId}")
    TotalScore findById(Integer studentId);




    //更新
    @Update("update totalScore set studentId=#{studentId},politicalScore=#{politicalScore},researchScore=#{researchScore},socialScore=#{socialScore} where studentId=#{studentId}")
    void updateto(TotalScore totalScore);




    //删除
    @Delete("delete from totalScore where studentId=#{studentId}")
    void delete(Integer studentId);
}
